const SYSTEM_INFO = uni.getSystemInfoSync();
export const getStatusBarHeight = () => SYSTEM_INFO.statusBarHeight || 0;


export const getTitleBarHeight = () => {
	let result = 40
	// #ifndef H5
	if (uni.getMenuButtonBoundingClientRect()) {
		const {
			top,
			height
		} = uni.getMenuButtonBoundingClientRect();
		result = height + (top - getStatusBarHeight()) * 2;
	}
	// #endif
	return result;
}

export const getStatusBarAndTitleMaginTop = () => {
	let result = 20
	// #ifndef H5
	if (uni.getMenuButtonBoundingClientRect()) {
		const {
			top
		} = uni.getMenuButtonBoundingClientRect();
		result = top
	}
	// #endif
	return result;
}